package org.guiceside.persistence.hibernate.dao.hquery;

import org.guiceside.persistence.hibernate.dao.enums.Persistent;
import org.guiceside.persistence.hibernate.dao.enums.ReturnType;
import org.guiceside.persistence.entity.IdEntity;

/**
 * 该查询只加载 不会进行查询查询操作
 * Created by IntelliJ IDEA.
 * User: zhenjia
 * Date: 2009-3-30
 * Time: 12:32:32
 * To change this template use File | Settings | File Templates.
 */
public class HQueryLoad extends HQueryCore {

    
    public  HQueryLoad(HQueryContent hQueryContent){
        setHQueryContent(hQueryContent);
    }
    
    public void delete() {
        invoke(Persistent.DELETE);
    }

    public void delete(HQueryCallBack hQueryCallBack) {
        setCurrentHQueryCallBack(hQueryCallBack);
        invoke(Persistent.DELETE);
    }





    public void save() {
        invoke(Persistent.SAVEORUPDATE);
    }

    public void save(HQueryCallBack hQueryCallBack) {
        setCurrentHQueryCallBack(hQueryCallBack);
        invoke(Persistent.SAVEORUPDATE);
    }

    @Override
    public HQueryLoad logicOr(int from, int to) {
        super.logicOr(from, to);    //To change body of overridden methods use File | Settings | File Templates.
        return getCurrentHQueryLoad();
    }

    @Override
    public HQueryLoad merge(int from, int to) {
        super.merge(from, to);    //To change body of overridden methods use File | Settings | File Templates.
        return getCurrentHQueryLoad();
    }

    @Override
    public HQueryLoad returnType(ReturnType returnType) {
        super.returnType(returnType);    //To change body of overridden methods use File | Settings | File Templates.
        return getCurrentHQueryLoad();
    }
    
    public HQueryLoad each(EachAdapter eachAdapter) {
        eachAdapter.init(getHQueryContent());
        eachAdapter.each();
        return getCurrentHQueryLoad();
    }

    public Object attr(String column){
        return invokeAttr(column);
    }

    public HQueryLoad attr(String column,Object value){
        invokeAttr(column,value);
        return getCurrentHQueryLoad();
    }
    

}
